package cn.wolfcode.wolf2w.controller;


import cn.wolfcode.wolf2w.domain.Spot;
import cn.wolfcode.wolf2w.queryObject.SpotQueryObject;
import cn.wolfcode.wolf2w.service.ISpotService;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("spots")
public class SpotController {

    @Autowired
    private ISpotService spotService;

    /**
     * 攻略前端页面列表 api
     * @return
     */
    @GetMapping("/query")
    @ResponseBody
    public Object query(){

        List<Spot> list = spotService.list();
        System.out.println(list);
        return JsonResult.success(list);
    }



}
